import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "@/views/Home.vue";
import Mapbox from "@/views/Mapbox.vue";
import Maptalks from "@/views/Maptalks.vue";
import Multiple from "@/views/Multiple.vue";
import Other from "@/views/Other.vue";
import OtherSub from "@/views/OtherSub.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: "/home",
    name: "home",
    component: Home,
  },
  {
    path: "/mapbox",
    name: "mapbox",
    component: Mapbox,
  },
  {
    path: "/maptalks",
    name: "maptalks",
    component: Maptalks,
  },
  {
    path: "/other",
    name: "other",
    component: Other,
  },
  {
    path: "/other/:path",
    name: "other-sub",
    component: OtherSub,
  },
  {
    path: "/all",
    name: "all",
    component: Multiple,
  },
  {
    path: "/",
    redirect: "/home",
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
